package com.atm.publish;


import com.google.common.collect.Lists;

import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * config
 * @author shangqing.liu
 */
public class PublishConst {
    public static List<ProjectServerVo> projectServerVoList;
    public static Map<String, ProjectServerVo> projectServerVoMap;

    static {

        ProjectServerVo admin_web_1 = new ProjectServerVo("admin_web_1",
                "admin(java)",
                "web-1",
                "123.12.71.184",
                "root",
                "111",
                "/data/admin",
                "/data/atm-admin/logs/loginfo.log",
                "/data/admin/deploy.sh");

        ProjectServerVo openapi_web_1 = new ProjectServerVo("openapi_web_1",
                "openapi(java)",
                "web-1",
                "123.12.71.184",
                "root",
                "2222",
                "/data/openapi",
                "/data/openapi/logs/loginfo.log",
                "/data/openapi/deploy.sh");

        ProjectServerVo ui_web_1 = new ProjectServerVo("ui_web_1",
                "ui(前端)",
                "web-2",
                "123.12.71.184",
                "root",
                "333",
                "/data/ui",
                "",
                "/data/ui/deploy.sh");

        projectServerVoList = Lists.newArrayList(admin_web_1, openapi_web_1, ui_web_1);

        projectServerVoMap =
                projectServerVoList.stream().collect(Collectors.toMap(ProjectServerVo::getProjectServerNo,
                        Function.identity(), (key1, key2) -> key2));
    }

}
